<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 * autores: Carlos Castillo 
 *          Alejandro Ballesta
 */
    if (!isset($_SESSION))
    session_start();
    
    if(isset($_GET['id2'])){
       include_once($_SESSION['dir'].'/Solicitud/solicitud.php');
       $temp = new solicitud($_GET['id2'], $_SESSION["k_username"],null);
       $temp->eliminar_solicitud();
       if(isset($_POST['aceptar'])){
            $baseD = new BaseDatos('esAmigo');
            $baseD ->agregarAmistad($_SESSION["k_username"], $_GET['id2']);
            Header("Location: responderSolicitudes.php?agr=".$_GET['id2']); 
       }else
           Header("Location: responderSolicitudes.php?rec=".$_GET['id2']);
       
    }
    else 
        echo "error";
    
    
?>
